#ifndef __WS_DIRECTIVE_H_
#define __WS_DIRECTIVE_H_
#include "Private.h"

#include "cJSON.h"
#include "cJSON_Utils.h"

#include <memory>

namespace sdk{
namespace msg{
class Directive
{
public:
    virtual ~Directive() {}
    EJsonMsgName getName() const;
    EJsonMsgNamesp getNamespace() const;
    const std::string &getMessageId() const;
    const std::string &getPayload() const;
    virtual std::string toJsonString() const;

public:
    static std::shared_ptr<Directive> parse(std::string_view jsonStr);

private:
    Directive() = default;
    Directive(const Directive &) = default;
    Directive(Directive &&) = default;
    virtual Directive &operator=(const Directive &) = default;
    virtual Directive &operator=(Directive &&) = default;

private:
    EJsonMsgName m_eName;
    EJsonMsgNamesp m_eNamesp;
    std::string m_messageId;
    std::string m_payload;
};
} // namespace msg
} // namespace sdk
#endif // ! __WS_DIRECTIVE_H_
